#!/bin/bash

set -e

BuildDir=pkg

wasm-pack build \
  --release \
  --target web \
  --out-dir $BuildDir \
  --out-name sketch_compute

# compute the wasm file's hash
sha256=$(shasum -a 256 $BuildDir/sketch_compute_bg.wasm | cut -d ' ' -f 1)
echo $sha256 > $BuildDir/sketch_compute_bg.wasm.sha256
